import requests

from app.main.dao.hello_dao import HelloDao
from app.main.entity.hello import Hello
from app.util.result import Result
# from app.util.get_static_path import get_path


# 业务逻辑实现，简单添加方法即可
def hello(request_data):
    hello_list = Hello(request_data)
    # if hello_list.hello_run:
    df = HelloDao.select()  # 数据库操作示例
    return Result.success(data=df)


# 传输图片示例,将图片放到static文件夹下，调用get_path传入文件名获得绝对路径，url填写接收方接口的url
# def send_picture():
#     files = {
#         "image_file": ("demo.jpg", open(get_path('demo.jpg'), 'rb'))}
#     requests.post('http://127.0.0.1:8081/upload', files=files)

if __name__ == '__main__':
    test = {'a': 1}
    hello(test)
